package com.david;


import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
public class MyController {

    @GetMapping
    public String list(HttpServletRequest req){
        req.getSession().setAttribute("aaa","ooo");
        return "xxoo";
    }

    @GetMapping("/get")
    public String get(HttpServletRequest req){
        Object aaa = req.getSession().getAttribute("aaa");
        System.out.println(aaa.toString());
        return "xxoo";
    }

}
